package com.ubs.common;

import com.ubs.dom.Account;
import com.ubs.persistence.PersistenceUtils;
import com.ubs.persistence.entity.AccountEntity;

public class ServerToWebAdaper {

	public static Account getAccount(AccountEntity ae) {
		
		Account account = new Account(ae.getId(), 
				ae.getLogin(), 
				ae.getEmail(), 
				ae.getBalance(),  
				PersistenceUtils.stringToBool(ae.getEnabled()));
		
		account.setFirstName(ae.getFirstName());
		account.setLastName(ae.getLastName());
		account.setPhoneNumber(ae.getPhoneNumber());
		
		return account;
	}
}
